//
//  UIViewController+MBProgressHUD.h
//  Epayment
//
//  Created by safiri on 2018/8/10.
//  Copyright © 2018年 safiri. All rights reserved.
//

#import <UIKit/UIKit.h>

@class MBProgressHUD;
@interface UIViewController (MBProgressHUD)

#pragma mark - text hud
/**
 只显示文字 time秒后消失 只用在有含有navgationController的界面上
 
 @param text 显示文字
 @param time time秒后消失
 */
- (void)showHUDWithTextInNav:(NSString *)text afterDelayTimeHide:(float)time;

/**
 只显示文字 time秒后消失 用在UIViewController上
 
 @param text 显示文字
 @param time time秒后消失
 */
- (void)showHUDWithText:(NSString *)text afterDelayTimeHide:(float)time;

/**
 在指定view上显示文字 time秒后消失

 @param text 显示文字
 @param view 指定view
 @param time time秒后消失
 */
- (void)showHUDWithText:(NSString *)text inView:(UIView *)view afterDelayTimeHide:(float)time;

/**
 2秒后自动隐藏的提示文字HUD

 @param view 指定view
 @param text 显示文字
 */
- (void)showAutoHideHudInView:(UIView *)view withText:(NSString *)text;
/**
 2.0f秒后自动隐藏的提示文字HUD
 显示在self.view上
 @param text 提示文字
 */
- (void)showAutoHideHudWithText:(NSString *)text;


/**
 在Nav上2.0f秒后自动隐藏的hud
 显示在self.navigationController.view上
 @param text 提示文字
 */
- (void)showAutoHideHudInNavWithText:(NSString *)text;

#pragma mark - waiting hud
/**
 当前页面显示的等待类型的MBHUD
 */
@property (nonatomic ,strong) MBProgressHUD *waitingMBHUD;

/**
 显示等待HUD
 
 @param bgView 显示目标view
 */
- (void)showWaitingHUDInView:(UIView *)bgView;

/**
 显示等待HUD,含提示文字
 
 @param bgView 显示目标view
 @param hintString 提示文字
 */
- (void)showWaitingHUDInView:(UIView *)bgView andWaitingHintString:(NSString *)hintString;

/**
 隐藏等待HUD
 
 @param bgView 隐藏目标view
 */
- (void)hideWaitingHUDInView:(UIView *)bgView;

#pragma mark - progress hud
/**
 显示进度HUD,含提示文字

 @param text 提示文字
 @param progress 进度
 */
- (void)showProgressRingShapedHUDInSelfViewWaitText:(NSString *)text progress:(NSProgress *)progress;
/**
 显示进度HUD,含提示文字
 
 @param text 提示文字
 @param progress 进度
 */
- (void)showProgressHorizontalBarMBHUDHUDInSelfViewWaitText:(NSString *)text progress:(NSProgress *)progress;

/**
 隐藏进度HUD
 */
- (void)hideProgressRingShapedHUDInSelfView;

/**
 隐藏进度HUD
 */
- (void)hideProgressHorizontalBarHUDInSelfView;

#pragma mark - custom hud

/**
 显示自定义hud

 @param bgView bgView
 @param customView customView
 @param text text
 */
- (void)showCustomHUDInView:(UIView *)bgView custom:(UIView *)customView text:(NSString *)text;
- (void)showCustomHUDAutoHideInView:(UIView *)bgView custom:(UIView *)customView text:(NSString *)text;
/**
 隐藏HUD
 
 @param bgView 隐藏目标view
 */
- (void)hideHUDInView:(UIView *)bgView;
@end
